﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NbMeterServices.Entity
{
    /// <summary>
    /// 定价表
    /// </summary>
    [SugarTable("MR_ChargingSettings", "定价表")]
    public class MrChargingSettings 
    {
        /// <summary>
        /// 雪花Id
        /// </summary>
        [SugarColumn(ColumnName = "Id", ColumnDescription = "主键Id", IsPrimaryKey = true, IsIdentity = false)]
        public long Id { get; set; }
        /// <summary>
        /// 设置名称
        /// </summary>
        [SugarColumn(ColumnName = "Name", ColumnDescription = "设置名称", Length = 32)]
        public string? Name { get; set; }

        /// <summary>
        /// 账单周期
        /// </summary>
        [SugarColumn(ColumnName = "BillingCycle", ColumnDescription = "账单周期")]
        public int BillingCycle { get; set; }
        /// <summary>
        /// 账单日
        /// </summary>
        [SugarColumn(ColumnName = "BillDate", ColumnDescription = "账单日")]
        public int? BillDate { get; set; }

        /// <summary>
        /// 仪表类型
        /// </summary>
        [SugarColumn(ColumnName = "MeterType", ColumnDescription = "仪表类型")]
        public int? MeterType { get; set; }

        /// <summary>
        /// 单价模式
        /// </summary>
        [Required]
        [SugarColumn(ColumnName = "IsFixedMode", ColumnDescription = "单价模式")]
        public bool IsFixedMode { get; set; }

        /// <summary>
        /// 固定价格
        /// </summary>
        [SugarColumn(ColumnName = "FixedPrice", ColumnDescription = "固定价格", Length = 8, DecimalDigits = 2)]
        public decimal? FixedPrice { get; set; }

        [SugarColumn(ColumnName = "TierePricingData", ColumnDescription = "阶梯价格", Length = 32)]
        public string? TierePricingData { get; set; }

        /// <summary>
        /// 租户Id
        /// </summary>
        [SugarColumn(ColumnName = "TenantId", ColumnDescription = "租户Id")]
        public long? TenantId { get; set; }

        /// <summary>
        /// 归属对象
        /// </summary>
        [Required]
        [SugarColumn(ColumnName = "BelongTo", ColumnDescription = "归属对象")]
        public long BelongTo { get; set; }

        /// <summary>
        /// 软删除
        /// </summary>
        [SugarColumn(ColumnDescription = "软删除")]
        public virtual bool IsDelete { get; set; } = false;


        [SugarColumn(ColumnName = "EventConfig", ColumnDescription = "EventConfig")]
        public string? EventConfig { get; set; }
    }
}
